package cn.zorbus.laian.application.task;

import cn.zorbus.laian.infrastructure.bus.UdpEventBus;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * create in 2023/12/27 17:41
 *
 * @author shishaodong
 * @version 0.0.1
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class InitTask {

    private static final String INIT = "0";

    private final UdpEventBus eventBus;

    @Scheduled(fixedRate = 1000)
    public void init() {
        eventBus.sentEvent(INIT);
        log.debug("初始化 {}", INIT);
    }
}
